<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>招聘会详情</title>
	<link rel="stylesheet" href="./styles/css/common.css">
</head>

<body>
	<div class="zph_detail">
		<!-- 公共顶部 -->
		<!-- <include src="./include/top.html"></include> -->
		<script src="http://rsj.beijing.gov.cn/header.js"></script>

		<!-- 头部 -->
		<div class="job_header">
			<div class="job_header_con clearfix">
				<a href="./index.html" class="left">
					<img src="./styles/images/logo.png" alt="">
				</a>
				<span class="left job_fontimg"></span>
			</div>
		</div>
		<!-- 职位详情 nav -->
		<div class="zpxq_nav" id="J_area">
			<script type="text/html" id="J_item">
			<%if(+data.executeResult == 1){%>
				<% var _data = data.zphxx%>
			<div class="zpxq_nav_con clearfix">
				<div class="nav_left left">
					<p class="nav_time">开始时间： <%=_data.zphkssj?_data.zphkssj.substring(0,10):"--"%>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						结束时间：<%=_data.zphjssj?_data.zphjssj.substring(0,10):"--"%></p>
					<p class="nav_name"><%=_data.zphmc%></p>
					<div class="nav_wz clearfix">
						<!-- <p class="nav_dz left">地址：<%=_data.zphdd%></p> -->
						<p class="nav_dw left">主办单位：<%=_data.zbjgmc%></p>
					</div>
				</div>
				<div class="nav_right right">
					<p class="nav_num"><%=_data.cgdws%></p>
					<p class="nav_num_title">参会单位数量（家）</p>
				</div>
			</div>
			<%}%>
			</script>
		</div>
		<!-- hot热招岗位 -->
		<div class="zpxq_hot clearfix">
			<i class="left hot_icon"></i>
			<div class="left hot_list">
				<div class="left J_zphgw scrollbar">
				</div>
				<!-- <span class="hot_more left">更多</span> -->
			</div>
		</div>

		<!-- 查询样式 -->
		<div class="resultpage_option clearfix">
			<!-- 查询样式 -->
			<div class="z_b_bottom clearfix">
				<div class="option_left left">
					参会单位列表
				</div>
				<div class="option_right right">
					<label style="top: 0px;left: 18px;" class="passes Showpass" for="rs">请输入您要查询的单位或岗位</label>
					<input class="search_input" type="text" id="rs">
					<input type="button" class="search_submit J_search_submit" value="">
				</div>
			</div>
		</div>
		<!-- 分页列表 -->
		<div class="zpxq_content" id="page_table">
			<script type="text/html" id="resultpage_area">
			<%if(data.executeResult == 1){%>
			<%var _data = data.dwlb%>
			<%for(var i=0;i<_data.length;i++){%>
				<% var _item = _data[i]%>
				<!-- <% var _itemArr = _data[i].gwList%> -->
				<% var _itemArr = _data[i].zphgwList%>
			<div class="zpxq_c_item">
				<div class="c_item_top clearfix">
					<div class="c_item_top_left left overshow" title="<%=_item.dwmc%>"><%=_item.dwmc%></div>
					<div class="c_item_top_right right">
						<p class="c_item_top_name left">联系人：<%=_item.dwlxr?_item.dwlxr:'暂无'%></p>
						<p class="c_item_top_phone left">电话：<%=_item.lxfs?_item.lxfs:'暂无'%></p>
					</div>
				</div>
				<div class="c_item_bottom clearfix">
					<div class="c_item_bottom_left left">岗位数量：<%=_item.gws%></div>
					<div class="c_item_bottom_right right J_show">展开</div>
				</div>
				<div class="zpxq_c_list clearfix scrollbar">
					<%for(var j=0;j<_itemArr.length;j++){%>
						<% var _single = _itemArr[j] %>
					<div class="zpxq_c_list_item">
						<!-- <div class="zpxq_c_list_title">
							<p class="overshow" title="<%=_item.dwmc%>"><%=_item.dwmc%></p>
						</div> -->
						<div class="zpxq_c_list_con">
							<div class="c_list_mes1 clearfix">
								<p class="mes1_name left overshow" title="<%=_single.gwmc%>"><%=_single.gwmc%></p>
								<p class="mes1_price right"><%=_single.gzdy%></p>
							</div>
							<p class="c_list_mes2">人数：<%=_single.zrs%>人</p>
							<p class="c_list_mes3 overshow" title="<%=_single.xcdy%>">福利待遇：<%=_single.xcdy?_single.xcdy:'暂无'%></p>
							<!-- <p class="c_list_mes3" title="<%=_single.gwyq%>">岗位要求：<%= spliceString(_single.gwyq)%></p> -->
						</div>
					</div>
					<%}%>
				</div>
			</div>
			<%}%>
			<%}%>

		</script>
		</div>
		<!-- 公共尾部 -->
		<!-- <include src="./include/footer.html"></include> -->
	<script src="http://rsj.beijing.gov.cn/footer.js"></script>
	</div>
</body>
<script src="./common/vendor.js"></script>
<script src="./common/common.js"></script>
<script src="./common/generaltools.js"></script>
<script src="./date/WdatePicker.js"></script>
<script>
	$(function () {

		var zpq_Arr = [];
		// 获取基本信息
		getBase();
		var zphid = $.paramObj().zphid;
		// 单位信息
		getDwxx(zphid);
		// 获取岗位信息
		getStation(zphid);

		// 点击查询
		$(document).on('click', '.J_search_submit', function () {
			var _ssmc = $('.search_input').val();
			getPage(_ssmc, zpq_Arr);
		})
		// 点击展开
		$(document).on('click', '.J_show', function () {
			var _class = $(this).hasClass('zk_active');
			var _parent = $(this).parents('.zpxq_c_item');
			if (!_class) {
				$(this).addClass('zk_active');
				$(this).text('收起');
				_parent.find('.zpxq_c_list').slideDown();
			} else {
				$(this).removeClass('zk_active');
				$(this).text('展开');
				_parent.find('.zpxq_c_list').slideUp();
			}
		})
		// 选择城区
		$(document).on('click', '.hot_item', function () {
			var _class = $(this).hasClass('hot_active');
			if (!_class) {
				$(this).addClass('hot_active');
				$('.all_hot_item').removeClass('hot_active');
				zpq_Arr.push($(this).text());
				$('.J_search_submit').click();
			} else {
				$(this).removeClass('hot_active');
				zpq_Arr.splice(zpq_Arr.indexOf($(this).text()), 1);
				$('.J_search_submit').click();
			}
			if (zpq_Arr.length == 0) {
				$('.all_hot_item').addClass('hot_active');
			}
		})
		// 全部区县
		$(document).on('click', '.all_hot_item', function () {
			var _class = $(this).hasClass('hot_active');
			if (!_class) {
				$(this).addClass('hot_active');
				$('.hot_item').removeClass('hot_active');
				zpq_Arr = [];
				$('.J_search_submit').click();

			}
		})
		// 点击更多
		$(document).on('click', '.hot_more', function () {
			var _class = $(this).hasClass('sq');
			if (!_class) {
				$(this).addClass('sq');
				$(this).text('收起');
				$('.hot_item').show();
			} else {
				$(this).removeClass('sq');
				$(this).text('更多');
				$('.hot_item').each(function (k, v) {
					if (k < 5) {
						$(this).show();
					} else {
						$(this).hide();
					}
				});
			}
		})

		$(document).on('focus', '.search_input', function () {
			$(this).prev('.Showpass').hide();
		})
		$(document).on('blur', '.search_input', function () {
			if (!$(this).val()) {
				$(this).prev('.Showpass').show();
			}
		})

		// 获取单位信息
		function getDwxx() {
			$.asyncRender({
				// url: '/zphxx/zphxxCx',
				url: '/zxhd/zphxxCx',
				type: 'get',
				data: {
					zphid: zphid
				},
				wrap: '#J_area',
				tem: '#J_item',
				pos: 'returnData',
			}).done(function (res) {
				var _res = res.returnData;
				if (+_res.executeResult === 1) {
				} else {
					$.layerMsg(_res.message, '我知道了');
				}
			})
		}
		// 招聘会岗位查询
		function getStation(zphid) {
			$.fetch({
				// url: '/zphxx/zphgwCx',
				url: '/zxhd/zphgwCx',
				type: 'get',
				data: {
					zphid: zphid
				}
			}).done(function (res) {
				var _res = res.returnData;
				if (+_res.executeResult == 1) {
					var _data = _res.gwlb;
					var _html = '<span class="all_hot_item hot_active">全部</span>';
					$.each(_data, function (k, v) {
						if (k < 5) {
							_html += '<span class="hot_item">' + v.gwmc + '</span>';
						} else {
							_html += '<span class="hot_item hide">' + v.gwmc + '</span>'
						}
					})
					$('.J_zphgw').html(_html);
					// $('.hot_more').show();
				} else {
					// $('.hot_more').hide();
					$.layerMsg(_res.message, '我知道了');
				}
			})
		}

		// 招聘会岗位分组查询
		getPage()
		function getPage(ssmc, zpq) {
			var index = 0;
			var data = {
				ssmc: ssmc || '',
				gwmcs: zpq || [],
				zphid: zphid,
				pageSize: 20,
				pageNum: index
			}
			$('#page_table').pageTool({
				// url: '/zphxx/dwlbCx',
				url: '/zxhd/zphdwlbCx',
				type: 'post',
				data: data,
				locator: 'returnData',
				errMes: '当前无相关招聘信息！！',
				callback: function (res) {
					var _res = res.returnData;
					if (_res.executeResult == '1') {
						index++;
					} else {
						$.layerMsg(_res.message, '我知道了', function () {
							return false;
						});
					}
				}
			});
		}


		template.helper('spliceString', function (str) {
			if (str) {
				if (str.length > 35) {
					return str.substring(0, 35) + '...';
				} else {
					return str;
				}
			}else{
				return '暂无';
			}
		});

	});
</script>

</html>
